<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        //1.没有预解析
        // const a=10;
        // console.log(a);

        // console.log(a);
        // const a=10;

        //2.块级作用域
        const b=10;
        if(1==1){
            const b=20;
            console.log(b);  //20
        }
        console.log(b);   //10

        //3.不能重名，否则报错
        const c=30;
        // const c=40;

        //4.暂时性死区
        // const d=10;
        // function fn(){
        //     console.log(d);  //报错
        //     const d=30;
        // }
        // fn()

        //5.必须赋值
        const e;  //报错
    </script>
</body>
</html>